package person;

import java.io.Serializable;

import organization.Group;

public class Student extends PersonInfo implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4L;
	private Group group;
	
	public Student (PersonInfo info){
		super.setFirstName(info.getFirstName());
		super.setSecondName(info.getSecondName());
		super.setPlaceOfBirth(info.getPlaceOfBirth());
		super.birth=info.getBirth();
	}
	public Student (){}
	public void addToGroup (Group grp){
		if (group == null){
			group=grp;
			System.out.println("Student added to "+group.getGrpName()+" group");
		}else{
			System.out.println("Student already exist in "+group.getGrpName()+" group.");
		}
	}
	public Group getGroup() {
		if (group != null){
			return group;
		}
		return null;
	}
	
}
